﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GenerateAdminPage.Classes.Views
{
    #region USING
    using GenerateAdminPage.Classes.Helpers;
    using GenerateAdminPage.Classes.DBStructure;
    #endregion

    public class ViewSingleMoreAttrs : AbstractViews
    {
        public override string GenerateInitializeComponent()
        {
            StringBuilder Result = new StringBuilder();

            Result.AppendLine(TAB2 + "private void InitializeComponent()");
            Result.AppendLine(TAB2 + "{");
            Result.AppendLine(TAB3 + "this.components = new System.ComponentModel.Container();");
            Result.AppendLine(TAB3 + "System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();");
            Result.AppendLine(TAB3 + "System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmQuanLy" + TblOne.Name + "));");
            Result.AppendLine(TAB3 + "this.panelEx1 = new DevComponents.DotNetBar.PanelEx();");
            Result.AppendLine(TAB3 + "this.lblManageName = new DevComponents.DotNetBar.LabelX();");
            Result.AppendLine(TAB3 + "this.panelEx2 = new DevComponents.DotNetBar.PanelEx();");
            Result.AppendLine(TAB3 + "this.grpManageInfo = new DevComponents.DotNetBar.Controls.GroupPanel();");

            int count = 0;
            for (int i = 0; i < TblOne.Attributes.Count; i++)
            {
                Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + " = new DevComponents.DotNetBar.LabelX();");

                if (TblOne.Attributes[i].IsForeignKey)
                {
                    Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].ReferTo + " = new System.Windows.Forms.Button();");
                }

                if (TblOne.Attributes[i].Type == DataType.IMAGE)
                {
                    if (count == 0)
                    {
                        Result.AppendLine(TAB3 + "this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();");
                        count++;
                    }
                }
            }
            
            Result.AppendLine(TAB3 + "this.panel2 = new System.Windows.Forms.Panel();");
            Result.AppendLine(TAB3 + "this.dtgvData = new DevComponents.DotNetBar.Controls.DataGridViewX();");
            Result.AppendLine(TAB3 + "this.panel1 = new System.Windows.Forms.Panel();");
            Result.AppendLine(TAB3 + "this.binFunctions = new System.Windows.Forms.BindingNavigator(this.components);");
            Result.AppendLine(TAB3 + "this.btnReset = new System.Windows.Forms.ToolStripButton();");
            Result.AppendLine(TAB3 + "this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();");
            Result.AppendLine(TAB3 + "this.btnThem = new System.Windows.Forms.ToolStripButton();");
            Result.AppendLine(TAB3 + "this.btnXoa = new System.Windows.Forms.ToolStripButton();");
            Result.AppendLine(TAB3 + "this.btnCapNhat = new System.Windows.Forms.ToolStripButton();");
            Result.AppendLine(TAB3 + "this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();");
            Result.AppendLine(TAB3 + "this.btnThoat = new System.Windows.Forms.ToolStripButton();");
            Result.AppendLine(TAB3 + "this.grpListData = new DevComponents.DotNetBar.Controls.GroupPanel();");
            Result.AppendLine(TAB3 + "this.panelEx1.SuspendLayout();");
            Result.AppendLine(TAB3 + "this.panelEx2.SuspendLayout();");
            Result.AppendLine(TAB3 + "this.grpManageInfo.SuspendLayout();");
            Result.AppendLine(TAB3 + "this.panel2.SuspendLayout();");
            Result.AppendLine(TAB3 + "((System.ComponentModel.ISupportInitialize)(this.dtgvData)).BeginInit();");
            Result.AppendLine(TAB3 + "this.panel1.SuspendLayout();");
            Result.AppendLine(TAB3 + "((System.ComponentModel.ISupportInitialize)(this.binFunctions)).BeginInit();");
            Result.AppendLine(TAB3 + "this.binFunctions.SuspendLayout();");
            Result.AppendLine(TAB3 + "this.grpListData.SuspendLayout();");

            Result.AppendLine(TAB3 + "// Need to modify" + END);

            if (Utils.HaveFKReferTo(DB, TblOne))
            {
                Result.AppendLine(TAB3 + "this.btnChon = new System.Windows.Forms.ToolStripButton();");
            }

            for (int i = 0; i < TblOne.Attributes.Count; i++)
            {
                if (TblOne.Attributes[i].IsForeignKey)
                {
                    Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].ReferTo + " = new DevComponents.DotNetBar.Controls.TextBoxX();");
                }
                else
                {
                    if (TblOne.Attributes[i].Type == DataType.DATETIME)
                    {
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + " = new DevComponents.Editors.DateTimeAdv.DateTimeInput();");
                    }
                    else if (TblOne.Attributes[i].Type == DataType.BOOL)
                    {
                        Result.AppendLine(TAB3 + "this.cbx" + TblOne.Attributes[i].Name + " = new DevComponents.DotNetBar.Controls.ComboBoxEx();");
                    }
                    else if (TblOne.Attributes[i].Type == DataType.IMAGE)
                    {
                        Result.AppendLine(TAB3 + "this.ptb" + TblOne.Attributes[i].Name + " = new System.Windows.Forms.PictureBox();");
                        Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].Name + " = new System.Windows.Forms.Button();");
                        Result.AppendLine(TAB3 + "this.btnXoa" + TblOne.Attributes[i].Name + " = new System.Windows.Forms.Button();");
                    }
                    else
                    {
                        Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].Name + " = new DevComponents.DotNetBar.Controls.TextBoxX();");
                    }
                }
            }

            Result.AppendLine(TAB3 + "// ------------------------------- E --------------------------------" + END);

            Result.AppendLine(TAB3 + "this.SuspendLayout();" + END);
            Result.AppendLine(TAB3 + "this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control;");
            Result.AppendLine(TAB3 + "this.panelEx1.Controls.Add(this.lblManageName);");
            Result.AppendLine(TAB3 + "this.panelEx1.Dock = System.Windows.Forms.DockStyle.Top;");
            Result.AppendLine(TAB3 + "this.panelEx1.Location = new System.Drawing.Point(0, 0);");
            Result.AppendLine(TAB3 + "this.panelEx1.Name = \"panelEx1\";");
            Result.AppendLine(TAB3 + "this.panelEx1.Size = new System.Drawing.Size(492, 52);");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.Peru;");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.White;");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;");
            Result.AppendLine(TAB3 + "this.panelEx1.Style.GradientAngle = 90;");
            Result.AppendLine(TAB3 + "this.panelEx1.TabIndex = 23;" + END);
            Result.AppendLine(TAB3 + "this.lblManageName.Dock = System.Windows.Forms.DockStyle.Fill;");
            Result.AppendLine(TAB3 + "this.lblManageName.Font = new System.Drawing.Font(\"Times New Roman\", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));");
            Result.AppendLine(TAB3 + "this.lblManageName.ForeColor = System.Drawing.Color.Blue;");
            Result.AppendLine(TAB3 + "this.lblManageName.Location = new System.Drawing.Point(0, 0);");
            Result.AppendLine(TAB3 + "this.lblManageName.Name = \"lblManageName\";");
            Result.AppendLine(TAB3 + "this.lblManageName.Size = new System.Drawing.Size(492, 52);");
            Result.AppendLine(TAB3 + "this.lblManageName.TabIndex = 1;");
            Result.AppendLine(TAB3 + "this.lblManageName.Text = \"" + TblOne.Name + "\";");
            Result.AppendLine(TAB3 + "this.lblManageName.TextAlignment = System.Drawing.StringAlignment.Center;" + END);
            Result.AppendLine(TAB3 + "this.panelEx2.CanvasColor = System.Drawing.SystemColors.Control;");
            Result.AppendLine(TAB3 + "this.panelEx2.Controls.Add(this.grpManageInfo);");
            Result.AppendLine(TAB3 + "this.panelEx2.Dock = System.Windows.Forms.DockStyle.Top;");
            Result.AppendLine(TAB3 + "this.panelEx2.Location = new System.Drawing.Point(0, 52);");
            Result.AppendLine(TAB3 + "this.panelEx2.Name = \"panelEx2\";");

            int panelEx2Size = 114;
            if ((double)TblOne.Attributes.Count / 2 > 2)
            {
                int numImage = 0;
                for (int i = 0; i < TblOne.Attributes.Count; i++)
                {
                    if (TblOne.Attributes[i].Type == DataType.IMAGE)
                    {
                        numImage++;
                    }
                }
                panelEx2Size += OFFSET_Y * (int)Math.Round((double)TblOne.Attributes.Count / 2 - 2, 0, MidpointRounding.AwayFromZero);
                panelEx2Size += numImage * 90;
            }

            Result.AppendLine(TAB3 + "this.panelEx2.Size = new System.Drawing.Size(492, " + panelEx2Size.ToString() + ");");
            Result.AppendLine(TAB3 + "this.panelEx2.Style.Alignment = System.Drawing.StringAlignment.Center;");
            Result.AppendLine(TAB3 + "this.panelEx2.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(142)))), ((int)(((byte)(179)))), ((int)(((byte)(231)))));");
            Result.AppendLine(TAB3 + "this.panelEx2.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(223)))), ((int)(((byte)(237)))), ((int)(((byte)(254)))));");
            Result.AppendLine(TAB3 + "this.panelEx2.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;");
            Result.AppendLine(TAB3 + "this.panelEx2.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;");
            Result.AppendLine(TAB3 + "this.panelEx2.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;");
            Result.AppendLine(TAB3 + "this.panelEx2.Style.GradientAngle = 90;");
            Result.AppendLine(TAB3 + "this.panelEx2.TabIndex = 24;" + END);
            Result.AppendLine(TAB3 + "this.grpManageInfo.CanvasColor = System.Drawing.SystemColors.Control;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;");

            Result.AppendLine(TAB3 + "// Need to modify");

            for (int i = 0; i < TblOne.Attributes.Count; i++)
            {
                Result.AppendLine(TAB3 + "this.grpManageInfo.Controls.Add(this.labelX" + (i + 1) + ");");

                if (TblOne.Attributes[i].IsForeignKey)
                {
                    Result.AppendLine(TAB3 + "this.grpManageInfo.Controls.Add(this.txt" + TblOne.Attributes[i].ReferTo + ");");
                    Result.AppendLine(TAB3 + "this.grpManageInfo.Controls.Add(this.btnChon" + TblOne.Attributes[i].ReferTo + ");");
                }
                else
                {
                    if (TblOne.Attributes[i].Type == DataType.DATETIME)
                    {
                        Result.AppendLine(TAB3 + "this.grpManageInfo.Controls.Add(this.dt" + TblOne.Attributes[i].Name + ");");
                    }
                    else if (TblOne.Attributes[i].Type == DataType.BOOL)
                    {
                        Result.AppendLine(TAB3 + "this.grpManageInfo.Controls.Add(this.cbx" + TblOne.Attributes[i].Name + ");");
                    }
                    else if (TblOne.Attributes[i].Type == DataType.IMAGE)
                    {
                        Result.AppendLine(TAB3 + "this.grpManageInfo.Controls.Add(this.ptb" + TblOne.Attributes[i].Name + ");");
                        Result.AppendLine(TAB3 + "this.grpManageInfo.Controls.Add(this.btnChon" + TblOne.Attributes[i].Name + ");");
                        Result.AppendLine(TAB3 + "this.grpManageInfo.Controls.Add(this.btnXoa" + TblOne.Attributes[i].Name + ");");
                    }
                    else
                    {
                        Result.AppendLine(TAB3 + "this.grpManageInfo.Controls.Add(this.txt" + TblOne.Attributes[i].Name + ");");
                    }
                }
            }
            Result.AppendLine(TAB3 + "// --------------------------------- E -------------------------------------" + END);

            Result.AppendLine(TAB3 + "this.grpManageInfo.Location = new System.Drawing.Point(53, 6);");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Name = \"grpManageInfo\";");

            int grpManageInfoSize = 92;
            if ((double)TblOne.Attributes.Count / 2 > 2)
            {
                int numImage = 0;
                for (int i = 0; i < TblOne.Attributes.Count; i++)
                {
                    if (TblOne.Attributes[i].Type == DataType.IMAGE)
                    {
                        numImage++;
                    }
                }
                grpManageInfoSize += OFFSET_Y * (int)Math.Round((double)TblOne.Attributes.Count / 2 - 2, 0, MidpointRounding.AwayFromZero);
                grpManageInfoSize += numImage * 90;
            }

            Result.AppendLine(TAB3 + "this.grpManageInfo.Size = new System.Drawing.Size(671, " + grpManageInfoSize.ToString() + ");" + END);
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.BackColorGradientAngle = 90;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.BorderBottomWidth = 1;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.BorderLeftWidth = 1;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.BorderRightWidth = 1;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.BorderTopWidth = 1;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.CornerDiameter = 4;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.TabIndex = 1;");
            Result.AppendLine(TAB3 + "this.grpManageInfo.Text = \"Thông Tin " + TblOne.Name + "\";");

            Result.AppendLine(TAB3 + "// Need to modify" + END);

            int firstLabelX = 42;
            int firstTextboxX = 137;
            int firstLabelY = 11;
            int firstTextboxY = 14;
            count = 0;
            for (int i = 0; i < TblOne.Attributes.Count; i++)
            {
                if (i % 2 != 0)
                {
                    firstLabelX = firstLabelX + OFFSET_X;
                    firstTextboxX = firstTextboxX + OFFSET_X;
                }
                else
                {
                    firstLabelX = 42;
                    firstTextboxX = 137;
                }

                if (i > 1 && i % 2 == 0)
                {
                    firstLabelY += OFFSET_Y;
                    firstTextboxY += OFFSET_Y;
                }

                if (TblOne.Attributes[i].Type != DataType.IMAGE)
                {
                    Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));");
                    Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".Location = new System.Drawing.Point(" + firstLabelX.ToString() + ", " + firstLabelY.ToString() + ");");
                    Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".Name = \"labelX" + (i + 1) + "\";");
                    Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".Size = new System.Drawing.Size(89, 23);");
                    Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".TabIndex = 100;");
                    if (TblOne.Attributes[i].IsForeignKey)
                    {
                        Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".Text = \"" + TblOne.Attributes[i].ReferTo + "\";" + END);
                    }
                    else
                    {
                        Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".Text = \"" + TblOne.Attributes[i].Name + "\";" + END);
                    }
                }

                if (TblOne.Attributes[i].IsForeignKey)
                {
                    Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].ReferTo + ".Border.Class = \"TextBoxBorder\";");
                    Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].ReferTo + ".Location = new System.Drawing.Point(" + firstTextboxX.ToString() + ", " + firstTextboxY.ToString() + ");");
                    Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].ReferTo + ".Name = \"txt" + TblOne.Attributes[i].ReferTo + "\";");
                    Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].ReferTo + ".ReadOnly = true;");
                    Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].ReferTo + ".Size = new System.Drawing.Size(148, 20);");
                    Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].ReferTo + ".TabIndex = " + i.ToString() + ";" + END);

                    Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].ReferTo + ".BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;");
                    Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].ReferTo + ".Image = ((System.Drawing.Image)(resources.GetObject(\"btnChonThamChieu.Image\")));");
                    Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].ReferTo + ".Location = new System.Drawing.Point(" + (firstTextboxX + 148 + 6).ToString() + ", " + (firstTextboxY - 5).ToString() + ");");
                    Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].ReferTo + ".Name = \"btnChon" + TblOne.Attributes[i].ReferTo + "\";");
                    Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].ReferTo + ".Size = new System.Drawing.Size(28, 27);");
                    Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].ReferTo + ".UseVisualStyleBackColor = true;");
                    Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].ReferTo + ".Click += new System.EventHandler(this.btnChon" + TblOne.Attributes[i].ReferTo + "_Click);");
                    Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].ReferTo + ".TabIndex = " + i.ToString() + ";" + END);
                }
                else
                {
                    if (TblOne.Attributes[i].Type == DataType.DATETIME)
                    {
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".BackgroundStyle.Class = \"DateTimeInputBackground\";");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".ButtonDropDown.Visible = true;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".CustomFormat = \"dd/MM/yyyy\";");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".Format = DevComponents.Editors.eDateTimePickerFormat.Custom;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".Location = new System.Drawing.Point(" + firstTextboxX.ToString() + ", " + firstTextboxY.ToString() + ");");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.AnnuallyMarkedDates = new System.DateTime[0];");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.BackgroundStyle.BackColor = System.Drawing.SystemColors.Window;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.ClearButtonVisible = true;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.CommandsBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.CommandsBackgroundStyle.BackColorGradientAngle = 90;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.CommandsBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.CommandsBackgroundStyle.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.CommandsBackgroundStyle.BorderTopColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarDockedBorder;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.CommandsBackgroundStyle.BorderTopWidth = 1;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.MarkedDates = new System.DateTime[0];");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.MonthlyMarkedDates = new System.DateTime[0];");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.NavigationBackgroundStyle.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.NavigationBackgroundStyle.BackColorGradientAngle = 90;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.NavigationBackgroundStyle.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".MonthCalendar.TodayButtonVisible = true;");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".Name = \"dt" + TblOne.Attributes[i].Name + "\";");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".Size = new System.Drawing.Size(182, 20);");
                        Result.AppendLine(TAB3 + "this.dt" + TblOne.Attributes[i].Name + ".TabIndex = " + i.ToString() + ";" + END);
                    }
                    else if (TblOne.Attributes[i].Type == DataType.BOOL)
                    {
                        Result.AppendLine(TAB3 + "this.cbx" + TblOne.Attributes[i].Name + ".DisplayMember = \"Text\";");
                        Result.AppendLine(TAB3 + "this.cbx" + TblOne.Attributes[i].Name + ".DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;");
                        Result.AppendLine(TAB3 + "this.cbx" + TblOne.Attributes[i].Name + ".FormattingEnabled = true;");
                        Result.AppendLine(TAB3 + "this.cbx" + TblOne.Attributes[i].Name + ".ItemHeight = 14;");
                        Result.AppendLine(TAB3 + "this.cbx" + TblOne.Attributes[i].Name + ".Location = new System.Drawing.Point(" + firstTextboxX.ToString() + ", " + firstTextboxY.ToString() + ");");
                        Result.AppendLine(TAB3 + "this.cbx" + TblOne.Attributes[i].Name + ".Name = \"cbx" + TblOne.Attributes[i].Name + "\";");
                        Result.AppendLine(TAB3 + "this.cbx" + TblOne.Attributes[i].Name + ".Size = new System.Drawing.Size(114, 20);");
                        Result.AppendLine(TAB3 + "this.cbx" + TblOne.Attributes[i].Name + ".TabIndex = " + i.ToString() + ";" + END);
                    }
                    else if (TblOne.Attributes[i].Type == DataType.IMAGE)
                    {
                        if (count == 0)
                        {
                            Result.AppendLine(TAB3 + "this.openFileDialog1.FileName = \"openFileDialog1\";");
                            count++;
                        }

                        if (i > 1 && i % 2 != 0)
                        {
                            firstLabelX = 42;
                            firstTextboxX = 137;
                            firstLabelY += OFFSET_Y;
                            firstTextboxY += OFFSET_Y;
                        }

                        Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));");
                        Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".Location = new System.Drawing.Point(" + firstLabelX.ToString() + ", " + firstLabelY.ToString() + ");");
                        Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".Name = \"labelX" + (i + 1) + "\";");
                        Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".Size = new System.Drawing.Size(89, 23);");
                        Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".TabIndex = 100;");
                        Result.AppendLine(TAB3 + "this.labelX" + (i + 1) + ".Text = \"" + TblOne.Attributes[i].Name + "\";" + END);

                        Result.AppendLine(TAB3 + "this.ptb" + TblOne.Attributes[i].Name + ".Anchor = System.Windows.Forms.AnchorStyles.Top;");
                        Result.AppendLine(TAB3 + "this.ptb" + TblOne.Attributes[i].Name + ".BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;");
                        Result.AppendLine(TAB3 + "this.ptb" + TblOne.Attributes[i].Name + ".InitialImage = null;");
                        Result.AppendLine(TAB3 + "this.ptb" + TblOne.Attributes[i].Name + ".Location = new System.Drawing.Point(" + firstTextboxX.ToString() + ", " + firstTextboxY.ToString() + ");");
                        Result.AppendLine(TAB3 + "this.ptb" + TblOne.Attributes[i].Name + ".Name = \"ptb" + TblOne.Attributes[i].Name + "\";");
                        Result.AppendLine(TAB3 + "this.ptb" + TblOne.Attributes[i].Name + ".Size = new System.Drawing.Size(148, 91);");
                        Result.AppendLine(TAB3 + "this.ptb" + TblOne.Attributes[i].Name + ".SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;");
                        Result.AppendLine(TAB3 + "this.ptb" + TblOne.Attributes[i].Name + ".TabStop = false;");

                        Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].Name + ".BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;");
                        Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].Name + ".Image = ((System.Drawing.Image)(resources.GetObject(\"btnChonThamChieu.Image\")));");
                        Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].Name + ".Location = new System.Drawing.Point(" + (firstTextboxX + 148 + 6).ToString() + ", " + (firstTextboxY).ToString() + ");");
                        Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].Name + ".Name = \"btnChon" + TblOne.Attributes[i].Name + "\";");
                        Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].Name + ".Size = new System.Drawing.Size(28, 27);");
                        Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].Name + ".UseVisualStyleBackColor = true;");
                        Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].Name + ".Click += new System.EventHandler(this.btnChon" + TblOne.Attributes[i].Name + "_Click);");
                        Result.AppendLine(TAB3 + "this.btnChon" + TblOne.Attributes[i].Name + ".TabIndex = " + i.ToString() + ";" + END);

                        Result.AppendLine(TAB3 + "this.btnXoa" + TblOne.Attributes[i].Name + ".BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;");
                        Result.AppendLine(TAB3 + "this.btnXoa" + TblOne.Attributes[i].Name + ".Image = ((System.Drawing.Image)(resources.GetObject(\"btnXoa.Image\")));");
                        Result.AppendLine(TAB3 + "this.btnXoa" + TblOne.Attributes[i].Name + ".Location = new System.Drawing.Point(" + (firstTextboxX + 148 + 6).ToString() + ", " + (firstTextboxY + 27).ToString() + ");");
                        Result.AppendLine(TAB3 + "this.btnXoa" + TblOne.Attributes[i].Name + ".Name = \"btnXoa" + TblOne.Attributes[i].Name + "\";");
                        Result.AppendLine(TAB3 + "this.btnXoa" + TblOne.Attributes[i].Name + ".Size = new System.Drawing.Size(28, 27);");
                        Result.AppendLine(TAB3 + "this.btnXoa" + TblOne.Attributes[i].Name + ".UseVisualStyleBackColor = true;");
                        Result.AppendLine(TAB3 + "this.btnXoa" + TblOne.Attributes[i].Name + ".Click += new System.EventHandler(this.btnXoa" + TblOne.Attributes[i].Name + "_Click);");
                    }
                    else
                    {
                        Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].Name + ".Border.Class = \"TextBoxBorder\";");
                        Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].Name + ".Location = new System.Drawing.Point(" + firstTextboxX.ToString() + ", " + firstTextboxY.ToString() + ");");
                        Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].Name + ".Name = \"txt" + TblOne.Attributes[i].Name + "\";");

                        if (TblOne.Attributes[i].IsPrimaryKey && TblOne.Attributes[i].IsIdentify)
                        {
                            Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].Name + ".ReadOnly = true;");
                        }

                        Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].Name + ".Size = new System.Drawing.Size(182, 20);");
                        Result.AppendLine(TAB3 + "this.txt" + TblOne.Attributes[i].Name + ".TabIndex = " + i.ToString() + ";" + END);
                    }
                }
            }

            Result.AppendLine(TAB3 + "// ---------------------------------- E -------------------------------------------" + END);
            Result.AppendLine(TAB3 + "this.panel2.Controls.Add(this.dtgvData);");
            Result.AppendLine(TAB3 + "this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;");
            Result.AppendLine(TAB3 + "this.panel2.Location = new System.Drawing.Point(0, 46);");
            Result.AppendLine(TAB3 + "this.panel2.Name = \"panel2\";");
            Result.AppendLine(TAB3 + "this.panel2.Size = new System.Drawing.Size(486, 295);");
            Result.AppendLine(TAB3 + "this.panel2.TabIndex = 2;" + END);
            Result.AppendLine(TAB3 + "this.dtgvData.AllowUserToAddRows = false;");
            Result.AppendLine(TAB3 + "this.dtgvData.BackgroundColor = System.Drawing.Color.White;");
            Result.AppendLine(TAB3 + "this.dtgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.Font = new System.Drawing.Font(\"Microsoft Sans Serif\", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.ControlText;");
            Result.AppendLine(TAB3 + "dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;");
            Result.AppendLine(TAB3 + "this.dtgvData.DefaultCellStyle = dataGridViewCellStyle1;");
            Result.AppendLine(TAB3 + "this.dtgvData.Dock = System.Windows.Forms.DockStyle.Fill;");
            Result.AppendLine(TAB3 + "this.dtgvData.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(208)))), ((int)(((byte)(215)))), ((int)(((byte)(229)))));");
            Result.AppendLine(TAB3 + "this.dtgvData.Location = new System.Drawing.Point(0, 0);");
            Result.AppendLine(TAB3 + "this.dtgvData.Name = \"dtgvData\";");
            Result.AppendLine(TAB3 + "this.dtgvData.ReadOnly = true;");
            Result.AppendLine(TAB3 + "this.dtgvData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;");
            Result.AppendLine(TAB3 + "this.dtgvData.Size = new System.Drawing.Size(486, 295);");
            Result.AppendLine(TAB3 + "this.dtgvData.TabIndex = 1;");
            Result.AppendLine(TAB3 + "this.dtgvData.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dtgvData_CellClick);" + END);
            Result.AppendLine(TAB3 + "this.panel1.BackColor = System.Drawing.Color.Transparent;");
            Result.AppendLine(TAB3 + "this.panel1.Controls.Add(this.binFunctions);");
            Result.AppendLine(TAB3 + "this.panel1.Dock = System.Windows.Forms.DockStyle.Top;");
            Result.AppendLine(TAB3 + "this.panel1.Location = new System.Drawing.Point(0, 0);");
            Result.AppendLine(TAB3 + "this.panel1.Name = \"panel1\";");
            Result.AppendLine(TAB3 + "this.panel1.Size = new System.Drawing.Size(486, 46);");
            Result.AppendLine(TAB3 + "this.panel1.TabIndex = 1;" + END);
            Result.AppendLine(TAB3 + "this.binFunctions.AddNewItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.BackColor = System.Drawing.Color.Transparent;");
            Result.AppendLine(TAB3 + "this.binFunctions.CountItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.DeleteItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.Dock = System.Windows.Forms.DockStyle.Fill;");
            Result.AppendLine(TAB3 + "this.binFunctions.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {");

            if (Utils.HaveFKReferTo(DB, TblOne))
            {
                Result.AppendLine(TAB3 + "this.btnChon,");
            }

            Result.AppendLine(TAB3 + "this.btnReset,");
            Result.AppendLine(TAB3 + "this.toolStripSeparator6,");
            Result.AppendLine(TAB3 + "this.btnThem,");
            Result.AppendLine(TAB3 + "this.btnXoa,");
            Result.AppendLine(TAB3 + "this.btnCapNhat,");
            Result.AppendLine(TAB3 + "this.toolStripSeparator5,");
            Result.AppendLine(TAB3 + "this.btnThoat});");
            Result.AppendLine(TAB3 + "this.binFunctions.Location = new System.Drawing.Point(0, 0);");
            Result.AppendLine(TAB3 + "this.binFunctions.MoveFirstItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.MoveLastItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.MoveNextItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.MovePreviousItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.Name = \"binFunctions\";");
            Result.AppendLine(TAB3 + "this.binFunctions.PositionItem = null;");
            Result.AppendLine(TAB3 + "this.binFunctions.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional;");
            Result.AppendLine(TAB3 + "this.binFunctions.Size = new System.Drawing.Size(486, 46);");
            Result.AppendLine(TAB3 + "this.binFunctions.TabIndex = 1;");
            Result.AppendLine(TAB3 + "this.binFunctions.Text = \"bindingNavigator1\";" + END);

            if (Utils.HaveFKReferTo(DB, TblOne))
            {
                Result.AppendLine(TAB3 + "this.btnChon.Image = ((System.Drawing.Image)(resources.GetObject(\"btnChon.Image\")));");
                Result.AppendLine(TAB3 + "this.btnChon.Name = \"btnChon\";");
                Result.AppendLine(TAB3 + "this.btnChon.RightToLeftAutoMirrorImage = true;");
                Result.AppendLine(TAB3 + "this.btnChon.Size = new System.Drawing.Size(40, 43);");
                Result.AppendLine(TAB3 + "this.btnChon.Text = \"Chọn\";");
                Result.AppendLine(TAB3 + "this.btnChon.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;");
                Result.AppendLine(TAB3 + "this.btnChon.Click += new System.EventHandler(this.btnChon_Click);" + END);
            }

            Result.AppendLine(TAB3 + "this.btnReset.Image = ((System.Drawing.Image)(resources.GetObject(\"btnReset.Image\")));");
            Result.AppendLine(TAB3 + "this.btnReset.Name = \"btnReset\";");
            Result.AppendLine(TAB3 + "this.btnReset.RightToLeftAutoMirrorImage = true;");
            Result.AppendLine(TAB3 + "this.btnReset.Size = new System.Drawing.Size(64, 43);");
            Result.AppendLine(TAB3 + "this.btnReset.Text = \"Nhập mới\";");
            Result.AppendLine(TAB3 + "this.btnReset.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;");
            Result.AppendLine(TAB3 + "this.btnReset.Click += new System.EventHandler(this.btnReset_Click);" + END);
            Result.AppendLine(TAB3 + "this.toolStripSeparator6.Name = \"toolStripSeparator6\";");
            Result.AppendLine(TAB3 + "this.toolStripSeparator6.Size = new System.Drawing.Size(6, 46);" + END);
            Result.AppendLine(TAB3 + "this.btnThem.Image = ((System.Drawing.Image)(resources.GetObject(\"btnThem.Image\")));");
            Result.AppendLine(TAB3 + "this.btnThem.Name = \"btnThem\";");
            Result.AppendLine(TAB3 + "this.btnThem.RightToLeftAutoMirrorImage = true;");
            Result.AppendLine(TAB3 + "this.btnThem.Size = new System.Drawing.Size(42, 43);");
            Result.AppendLine(TAB3 + "this.btnThem.Text = \"Thêm\";");
            Result.AppendLine(TAB3 + "this.btnThem.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;");
            Result.AppendLine(TAB3 + "this.btnThem.Click += new System.EventHandler(this.btnThem_Click);" + END);
            Result.AppendLine(TAB3 + "this.btnXoa.Image = ((System.Drawing.Image)(resources.GetObject(\"btnXoa.Image\")));");
            Result.AppendLine(TAB3 + "this.btnXoa.Name = \"btnXoa\";");
            Result.AppendLine(TAB3 + "this.btnXoa.RightToLeftAutoMirrorImage = true;");
            Result.AppendLine(TAB3 + "this.btnXoa.Size = new System.Drawing.Size(31, 43);");
            Result.AppendLine(TAB3 + "this.btnXoa.Text = \"Xóa\";");
            Result.AppendLine(TAB3 + "this.btnXoa.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;");
            Result.AppendLine(TAB3 + "this.btnXoa.Click += new System.EventHandler(this.btnXoa_Click);" + END);
            Result.AppendLine(TAB3 + "this.btnCapNhat.Image = ((System.Drawing.Image)(resources.GetObject(\"btnCapNhat.Image\")));");
            Result.AppendLine(TAB3 + "this.btnCapNhat.ImageTransparentColor = System.Drawing.Color.Magenta;");
            Result.AppendLine(TAB3 + "this.btnCapNhat.Name = \"btnCapNhat\";");
            Result.AppendLine(TAB3 + "this.btnCapNhat.Size = new System.Drawing.Size(59, 43);");
            Result.AppendLine(TAB3 + "this.btnCapNhat.Text = \"Cập nhật\";");
            Result.AppendLine(TAB3 + "this.btnCapNhat.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;");
            Result.AppendLine(TAB3 + "this.btnCapNhat.Click += new System.EventHandler(this.btnCapNhat_Click);" + END);
            Result.AppendLine(TAB3 + "this.toolStripSeparator5.Name = \"toolStripSeparator5\";");
            Result.AppendLine(TAB3 + "this.toolStripSeparator5.Size = new System.Drawing.Size(6, 46);" + END);
            Result.AppendLine(TAB3 + "this.btnThoat.Image = ((System.Drawing.Image)(resources.GetObject(\"btnThoat.Image\")));");
            Result.AppendLine(TAB3 + "this.btnThoat.ImageTransparentColor = System.Drawing.Color.Magenta;");
            Result.AppendLine(TAB3 + "this.btnThoat.Name = \"btnThoat\";");
            Result.AppendLine(TAB3 + "this.btnThoat.Size = new System.Drawing.Size(42, 43);");
            Result.AppendLine(TAB3 + "this.btnThoat.Text = \"Thoát\";");
            Result.AppendLine(TAB3 + "this.btnThoat.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;");
            Result.AppendLine(TAB3 + "this.btnThoat.Click += new System.EventHandler(this.btnThoat_Click);" + END);
            Result.AppendLine(TAB3 + "this.grpListData.CanvasColor = System.Drawing.SystemColors.Control;");
            Result.AppendLine(TAB3 + "this.grpListData.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.Office2007;");
            Result.AppendLine(TAB3 + "this.grpListData.Controls.Add(this.panel2);");
            Result.AppendLine(TAB3 + "this.grpListData.Controls.Add(this.panel1);");
            Result.AppendLine(TAB3 + "this.grpListData.Dock = System.Windows.Forms.DockStyle.Fill;");
            Result.AppendLine(TAB3 + "this.grpListData.Location = new System.Drawing.Point(0, 166);");
            Result.AppendLine(TAB3 + "this.grpListData.Name = \"grpListData\";");
            Result.AppendLine(TAB3 + "this.grpListData.Size = new System.Drawing.Size(492, 362);" + END);
            Result.AppendLine(TAB3 + "this.grpListData.Style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground2;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BackColorGradientAngle = 90;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBackground;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderBottom = DevComponents.DotNetBar.eStyleBorderType.Solid;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderBottomWidth = 1;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderLeft = DevComponents.DotNetBar.eStyleBorderType.Solid;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderLeftWidth = 1;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderRight = DevComponents.DotNetBar.eStyleBorderType.Solid;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderRightWidth = 1;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderTop = DevComponents.DotNetBar.eStyleBorderType.Solid;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.BorderTopWidth = 1;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.CornerDiameter = 4;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.CornerType = DevComponents.DotNetBar.eCornerType.Rounded;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.TextAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Center;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.TextColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;");
            Result.AppendLine(TAB3 + "this.grpListData.Style.TextLineAlignment = DevComponents.DotNetBar.eStyleTextAlignment.Near;");
            Result.AppendLine(TAB3 + "this.grpListData.TabIndex = 25;");
            Result.AppendLine(TAB3 + "this.grpListData.Text = \"Danh sách " + TblOne.Name + "\";" + END);
            Result.AppendLine(TAB3 + "this.ClientSize = new System.Drawing.Size(770, 636);");
            Result.AppendLine(TAB3 + "this.Controls.Add(this.grpListData);");
            Result.AppendLine(TAB3 + "this.Controls.Add(this.panelEx2);");
            Result.AppendLine(TAB3 + "this.Controls.Add(this.panelEx1);");
            Result.AppendLine(TAB3 + "this.DoubleBuffered = true;");
            Result.AppendLine(TAB3 + "this.MaximizeBox = false;");
            Result.AppendLine(TAB3 + "this.MinimizeBox = false;");
            Result.AppendLine(TAB3 + "this.Name = \"FrmQuanLy" + TblOne.Name + "\";");
            Result.AppendLine(TAB3 + "this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;");
            Result.AppendLine(TAB3 + "this.Text = \"Quản lý " + TblOne.Name + "\";");
            Result.AppendLine(TAB3 + "this.Load += new System.EventHandler(this.FrmQuanLy" + TblOne.Name + "_Load);");
            Result.AppendLine(TAB3 + "this.panelEx1.ResumeLayout(false);");
            Result.AppendLine(TAB3 + "this.panelEx2.ResumeLayout(false);");
            Result.AppendLine(TAB3 + "this.grpManageInfo.ResumeLayout(false);");
            Result.AppendLine(TAB3 + "((System.ComponentModel.ISupportInitialize)(this.dtgvData)).EndInit();");
            Result.AppendLine(TAB3 + "this.panel2.ResumeLayout(false);");
            Result.AppendLine(TAB3 + "((System.ComponentModel.ISupportInitialize)(this.binFunctions)).EndInit();");
            Result.AppendLine(TAB3 + "this.panel1.ResumeLayout(false);");
            Result.AppendLine(TAB3 + "this.panel1.PerformLayout();");
            Result.AppendLine(TAB3 + "this.binFunctions.ResumeLayout(false);");
            Result.AppendLine(TAB3 + "this.binFunctions.PerformLayout();");
            Result.AppendLine(TAB3 + "this.grpListData.ResumeLayout(false);");
            Result.AppendLine(TAB3 + "this.ResumeLayout(false);");
            Result.AppendLine(TAB2 + "}");

            return Result.ToString();
        }    
    }
}
